$(function() {
	$("#wxdenglu").click(function(){
		window.history.back(-1);
		
		
	})
	
	
	
	$("#loginPhone").val(sessionStorage.user_phone)
	 $("#loginPass").val(sessionStorage.user_pass_word)
	
	$("#Login").bind('click',function(){

		$.ajax({
			type: "post",
			url: "http://192.168.1.100/supermarket/data/login.php",
			async: true,
			data: {
				'user_phone': $("#loginPhone").val(),
				'user_pass_word': $("#loginPass").val()				
			},
			dataType: 'jsonp',
			jsonp: 'callback',
			jsonpCallback: "success_jsonpCallback",
			success: function(data) {
				//debugger;//断点
//				
           if(data.msg=="success"){
                    $("#dl").show();
                    $("#dl").text("登陆成功")
						setTimeout(function(){
							$("#dl").hide();
								},2000)

			localStorage.dizhi=data.info.user_addr;  
			localStorage.name=data.info.user_name;	  
			localStorage.user_phone=data.info.user_phone;	  
			localStorage.user_psd=data.info.user_psd;
			localStorage.user_sex=data.info.user_sex;	
		          window.location.href = 'my.html';	
				
				}else{
					
					 $("#dl").show();
					 $("#dl").text("登陆失败换个账号试试")
						setTimeout(function(){
							$("#dl").hide();
								},2000)
				}

			},
			error: function(datLogina) {
				
			}




		})

	})
})

